<style type="text/css">
.content{
    background: #f1f4f6;
}
body.is-dialog {
    background: #f1f4f6;
}
.box{
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 3px solid #ffffff;
}
.text_div{
    padding-top: 7px;
}
.plupload-preview li, .faupload-preview li{
     margin-top: 0px;
     margin-bottom: 0px;
}
.li_div{
    float: left;
}
.li_div_info{
    float: right;
    padding-left: 10px;
    padding-top: 17px;
}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="box">
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">審核狀態:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.status_text}</div>
        </div>
    </div>
    {if $row.audittime >0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Audittime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-audittime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text" value="{:$row.audittime?datetime($row.audittime):''}" disabled >
        </div>
    </div>
    {/if}
    {if $row.status  == 3}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">拒絕原因:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-audreason"  class="form-control" rows="5" cols="50" disabled>{$row.audreason|htmlentities}</textarea>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商家頭像:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview" id="p-avatar">
                <li class="li_div">
                    <div class="li_div">
                        <a href="{:cdnurl($row.avatar, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.avatar, true)}" class="img-responsive">
                        </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商家名稱:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.shop_name}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">公司地址:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.address}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">手機號:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.mobile}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">法人姓名:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.name}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">經營類目:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.cat_name}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">身份證號碼:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.id_card}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">身份證照片:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview">
                <li class="li_div">
                    <div class="li_div">
                        <a href="{:cdnurl($row.id_card_positive_images, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.id_card_positive_images, true)}" class="img-responsive">
                        </a>
                    </div>
                    <div class="li_div">
                        <a href="{:cdnurl($row.id_card_back_images, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.id_card_back_images, true)}" class="img-responsive">
                        </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">營業執照:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview">
                <li class="li_div">
                    <div class="li_div">
                        <a href="{:cdnurl($row.business_license_images, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.business_license_images, true)}" class="img-responsive">
                        </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">回鄉證號碼:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.return_permit}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">回鄉證照片:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview">
                <li class="li_div">
                    <div class="li_div">
                        <a href="{:cdnurl($row.return_permit_positive_images, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.return_permit_positive_images, true)}" class="img-responsive">
                        </a>
                    </div>
                    <div class="li_div">
                        <a href="{:cdnurl($row.return_permit_back_images, true)}" target="_blank" class="thumbnail">
                            <img src="{:cdnurl($row.return_permit_back_images, true)}" class="img-responsive">
                        </a>
                    </div>
                </li>
            </ul>
        </div>
    </div>

    {if $row.status  == 2}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">賬號:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.username}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">密碼:</label>
        <div class="col-xs-12 col-sm-8"><div class="text_div">{$row.password}</div>
        </div>
    </div>
    {/if}

</div>
    {if $row.status  == 1}

        <div class="box">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>審核狀態:</label>
                <div class="col-xs-12 col-sm-8">
                    <select id="c-status" data-rule=""  class="form-control selectpicker" name="row[status]" data-rule="required"  onchange="select_status()">
                        <option value="2">通過</option>
                        <option value="3">拒絕</option>
                    </select>
                </div>
            </div>
            <div class="form-group" id="username_div">
                <label class="control-label col-xs-12 col-sm-2"><a style="color: red" >*</a>{:__('Username')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-username" data-rule="length(~20)" class="form-control" name="row[username]" type="text" value="{$row.username|htmlentities}">
                </div>
            </div>
            <div class="form-group" id="password_div">
                <label class="control-label col-xs-12 col-sm-2"><a style="color: red" >*</a>{:__('Password')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-password" data-rule="length(~20)" class="form-control" name="row[password]" type="text" value="{$row.password|htmlentities}">
                </div>
            </div>
            <div class="form-group" id="audreason_div" style="display: none;">
                <label class="control-label col-xs-12 col-sm-2"><a style="color: red" >*</a>拒絕原因:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-audreason" data-rule="length(~20)" class="form-control" rows="5" name="row[audreason]" cols="50" placeholder="請填寫拒絕原因"></textarea>
                </div>
            </div>
        </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
    {/if}
</form>

<script type="text/javascript">
    
    function select_status() {
        var status=($("#c-status").val());
        if ( status==3 ) {
            $("#username_div").hide();
            $("#password_div").hide();
            $("#audreason_div").show();
        }else{
            $("#username_div").show();
            $("#password_div").show();
            $("#audreason_div").hide();
        }
    }
</script>